<template>
  <div id='cart' class='cart'>
    <nav-bar class="navBar">
      <div slot="center">购物车({{cartLength}})</div>
    </nav-bar>
    <cart-list />
    <cart-bottom-bar />
  </div>
</template>

<script>
  import NavBar from '../../components/common/navbar/navbar.vue'
  import CartList from './childComps/cartList.vue'
  import CartBottomBar from './childComps/cartBottomBar.vue'
  import {
    mapGetters
  } from 'vuex'
  export default {
    name: 'cart',
    props: { // 父辈向子辈传参
    },
    components: { // 组件的引用
      NavBar,
      CartList,
      CartBottomBar
    },
    data() {
      return {

      }
    },
    methods: { // 方法

    },
    computed: { // 计算属性
      ...mapGetters(['cartLength'])
    },
    created() { // 实例被创建之后执行代码

    },

    mounted() { // 页面进入时加载内容 
    },


    watch: { // 监测变化

    }
  }

</script>
<style scoped>
  .navBar {
    background: var(--color-text);
    color: white;
    font-size: 22px;
  }

  .cart {
    height: 100vh;
  }

</style>
